-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix received metadata handling #13736
Conversation
Travis fails due to latest libtorrent changes #5263. |
I don't think i understand what this fixes because i can't even reproduce without this patch. |
Do you use .!qb extension? |
No but i just tried it and couldn't reproduce. I can however reproduce with temp folder. i'll try the patch now. |
Still creates root in the temp folder. |
This is not the case. qBittorrent unconditionally creates a subfolder inside the temporary folder for multifile torrents to reduce filename conflict possibility. |
Interesting. Are you sure torrent is added before the metadata is received? Is it in "download metadata" state? |
Yes.
Silly me.. you've said it before but i keep forgetting. Maybe off topic but the root folder is not deleted from temp folder when delete torrent+files on a torrent with unchecked Keep top-level folder, only the files inside it. |
@thalieht, can you perform the following test (using current master/release qBittorrent)?
Does it affect previously downloaded data? |
No, current master. |
Interesting case... I usually have to look for an answer to the question why it doesn't work as expected. Now the question is why it works correctly (more precisely, why it gives results as if it works correctly), when it should not. |
/offtopic |
They should be renamed. If it's not, it's definitely a bug.
Yes. It's current behavior. |
92eea57
to
c572aa0
Compare
/Off topic
I don't use this feature and since this is known and deliberate, i don't think i should have an opinion on this. |
What exactly is the original problem(s) that this attempts to solve? Can you please provide more context? |
c572aa0
to
545345c
Compare
Me too.
Apparently for the same purpose - to see incomplete files outside the qBittorrent app. The question is, what is the point of deleting incomplete torrents and saving files? But it seems that someone has a reason to do so. |
When torrent is adding to qBittorrent we apply some preprocessing on its metadata:
There is no problem to apply this preprocessing when torrent is added with metadata provided.
The |
545345c
to
fd096ce
Compare
Should be fixed now. |
Indeed. |
In fact, the problem is even bigger. Since torrent is supposed to behave the same regardless of the way it is added (.torrent file or magnet link), we have to perform other kind of actions here in addition to handling the root folder. I mean searching for completed/incomplete files, as we do when adding torrent using .torrent file. And this is already more expensive operations that will take up the main libtorrent thread for a longer time, which is not very good.
What do you guys prefer? |
I think the only (or at least the most reliable) way to rewrite the files before adding a torrent, and without affecting files on disk, is to:
|
@qbittorrent/frequent-contributors, @qbittorrent/bug-handlers, please participate. |
I actually like this option. It can be useful not only in this issue. But it's hard for me to predict how long it will take for its implementation, so I would still use some kind of workaround until then. |
It will also disconnect peers. To mitigate disruption I would suggest saving resume data and capture the |
fd096ce
to
50b817a
Compare
I don't mind the UI disruption, but the queue position resetting is something we should try to mitigate. Maybe display "N/A" for it when the metadata is not yet available? so that users won't have false hope for it. |
50b817a
to
25fee87
Compare
25fee87
to
5431766
Compare
Now qBittorrent correctly deletes the root folder if the torrent was added via the magnet link and the metadata was received later.
The existing handling is absolutely incorrect. It was based on false premises. I wonder why it took so long for this to be discovered. Although, apparently, there were related Issues, but most likely left without attention due to incorrect explanations. And I almost never use this feature myself.